package com.letao.controller;

import com.letao.service.ItemParamItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2017/1/11.
 */
@Controller
public class ItemParamItemController {

    @Autowired
    private ItemParamItemService itemParamItemService;

    //返回一个逻辑视图,把 html展示到页面上
    @RequestMapping("/showItem/{itemId}")
    public String getItemParams(@PathVariable Long itemId, Model model){
        String html = itemParamItemService.getParaHtmlByItemId(itemId);
        model.addAttribute("itemParam", html);
        return "item";
    }
}
